import 'package:flutter/material.dart';

class TextRichDemo extends StatelessWidget {
  const TextRichDemo({
    Key key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Text.rich(
        TextSpan(
            children: [
              TextSpan(text: "helloWord", style: TextStyle(color: Colors.red)),
              TextSpan(text: "hello Flutter", style: TextStyle(color: Colors.green)),
              WidgetSpan(child: Icon(Icons.message,color: Colors.red,)),
              TextSpan(text: "hello dart", style: TextStyle(color: Colors.blue)),
            ]
        )
    );
  }
}

class TextWidget extends StatelessWidget {
  const TextWidget({
    Key key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Text("axios应该创建实例而不应该直接使用 应该创建两个实例 一个是查询实例 一个是更新数据的实例",
      textAlign: TextAlign.left,
      maxLines: 3,
      overflow: TextOverflow.ellipsis,
      style: TextStyle(
          fontSize: 20,
          color: Colors.red,
          fontWeight: FontWeight.bold
      ),
    );
  }
}